import { mapMutations, mapState } from 'vuex'

export default {
  methods: {
    ...mapMutations({
      change_isLogin: 'user/change_isLogin',
      change_userId: 'user/change_userId',
      change_token: 'user/change_token',
      change_cartList: 'cart/change_cartList'
    }),
    sayHello () {
      console.log('hello ' + this.n)
    }
  },
  computed: {
    ...mapState({
      userId: state => state.user.userId,
      isLogin: state => state.user.isLogin,
      token: state => state.user.token,
      cartList: state => state.cart.cartList
    }),
    n () {
      return 'my name is mixin'
    }
  },
  mounted () {
    console.log('this is mixin 的 mounted')
  }
}
